<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="vue.js"></script>
</head>
<body>
        <div id="app">
            <input type="text" v-model="inputValue"/>
            <button v-on:click="btnClick">点我</button>
            <ul>
                <li v-for="item  in  list">{{item}}</li>
            </ul>
        </div>
        <script>
           
            var app = new Vue({
                el:'#app',
                data:{
                    list:[],
                    inputValue:''
                },
                methods: {
                    btnClick:function(){
                        this.list.push(this.inputValue)
                        this.inputValue = ''
                       // alert(this.inputValue)
                    }
                },
            })

        </script>
</body>
</html>